package com.yunchang.springboot.mapper.mwsutils;

import com.yunchang.springboot.models.mwsutils.FOverseasWarehouseQuantity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface FOverseasWarehouseQuantityMapper {
    int deleteByPrimaryKey(Long id);

    int insert(FOverseasWarehouseQuantity record);

    int insertSelective(FOverseasWarehouseQuantity record);

    FOverseasWarehouseQuantity selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(FOverseasWarehouseQuantity record);

    int updateByPrimaryKey(FOverseasWarehouseQuantity record);

    /**
     * 根据参数获取amount的和
     * @param stockSku
     * @param shipmentId
     * @param debitSubjectId
     * @return
     */
    Double selectSumAmountByStockSkuAndShipmentIdAndDebitSubjectId(String stockSku,String shipmentId,String debitSubjectId);

    /**
     * 根据参数获取quantity的和
     * @param stockSku
     * @param shipmentId
     * @param debitSubjectId
     * @return
     */
    Integer selectSumQuantityByStockSkuAndShipmentIdAndDebitSubjectId(String stockSku,String shipmentId,String debitSubjectId);


    /**
     * 根据日期和是否生成生成出入库明细数据获取对应的数据
     * @param date
     * @param isInventoryDetails
     * @return
     */
    List<FOverseasWarehouseQuantity> selectByIsInventoryDetailsAndDate(@Param("date") String date, @Param("isInventoryDetails") Integer isInventoryDetails);

    /**
     * 根据fOverseasWarehouseQuantityList对象集合更新是否生成财务数据的状态
     * @param fOverseasWarehouseQuantityList
     * @return
     */
    int updateIsInventoryDetailsByFOverseasWarehouseQuantityList(@Param("fOverseasWarehouseQuantityList") List<FOverseasWarehouseQuantity> fOverseasWarehouseQuantityList);
}